﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows.Media.Imaging;

namespace EnergyConsumptionMonitorSystem.Converters
{
    public class ImageConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            bool? boolean = (bool?)value;
            switch (boolean)
            {
                case true:
                    {
                        return new BitmapImage(new Uri("/EnergyConsumptionMonitorSystem;component/Images/right.png", UriKind.Relative));
                    }
                case false:
                    {
                        return new BitmapImage(new Uri("/EnergyConsumptionMonitorSystem;component/Images/wrong.png", UriKind.Relative));
                    }
                case null:
                    {
                        return null; 
                    }
            }
            return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
